<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/view/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>${appname}-<c:if test="${!empty sessionScope._local_node_session}">${sessionScope._local_node_session.nodeName}-</c:if>${si:ctname("NET_TYPE",sessionScope._netType)}</title>
<%@ include file="/WEB-INF/view/common/css_js_ace.jsp"%>
<script type="text/javascript">

function mouseCoords(ev) 
{ 
	if(ev.pageX || ev.pageY){ 
	return {x:ev.pageX, y:ev.pageY}; 
	} 
	return { 
	x:ev.clientX + document.body.scrollLeft - document.body.clientLeft, 
	y:ev.clientY + document.body.scrollTop - document.body.clientTop 
	}; 
}

$(function(){
	$('.tipMe').tooltip({'placement':'top'});
	
	$("#sample-table-1 tbody td.mytip").mouseover(function(ev){
		if($(this).find("a").size()>0){
			ev= ev || window.event; 
			var mousePos = mouseCoords(ev); 
          var $point=$(this).find("a");
         $("#roadInfo .popover-content").empty();
         var data=eval("("+$point.attr("data")+")");
         var recvAdaptorcodes=(data.recvAdaptorcode==null?"":data.recvAdaptorcode.split(","));
         var recvAdaptornames=$.trim($point.find("span[name='recvAdaptorcode']").text()).split(",");
         var recvNodecodes=(data.recvNodecode==null?"":data.recvNodecode.split(","));
         var recvNodenames=$.trim($point.find("span[name='recvNodecode']").text()).split(",");
         var sendAdaptorcode=data.sendAdaptorcode;
         var sendNodecode=data.sendNodecode;
         for(var i=0;i<recvNodecodes.length;i++){
        	 var recvNodecode=null;
        	 if(recvNodecodes[i] && recvNodenames[i]){
        		 recvNodecode=recvNodenames[i];
        	 }else{
        		 if(recvNodecodes[i]){
        			 recvNodecode=recvNodecodes[i]
        		 }else{
        			 recvNodecode="";
        		 }
        	 }
        	 var recvSyscode=recvAdaptornames[i];
        	 $("#roadInfo .popover-content").append("<span  title='发送适配器'  class='tipMe fa fa-puzzle-piece'>&nbsp;"+sendAdaptorcode+"</span>");
        	 $("#roadInfo .popover-content").append("<span class='icon-arrow-right'></span>");
        	 $("#roadInfo .popover-content").append("<span  class='tipMe icon-desktop' title='发送节点'>&nbsp;"+sendNodecode+"</span>");
        	 $("#roadInfo .popover-content").append("<span class='icon-arrow-right'></span>");
        	 $("#roadInfo .popover-content").append(" <span  class='tipMe fa fa-cloud-download' title='刻盘'>&nbsp;刻盘</span>");
        	 $("#roadInfo .popover-content").append("<span class='icon-arrow-right'></span>");
        	 $("#roadInfo .popover-content").append("<span  class='tipMe icon-desktop' title='接收节点'>&nbsp;"+recvNodecode+"</span>");
        	 $("#roadInfo .popover-content").append("<span class='icon-arrow-right'></span>");
        	 $("#roadInfo .popover-content").append("<span  title='接收适配器'  class='tipMe fa fa-puzzle-piece'>&nbsp;"+recvSyscode+"</span>");
        	 $("#roadInfo .popover-content").append("<br/>");
         }
         
         $("#roadInfo").css("left",mousePos.x-$("#roadInfo").width()/2);
		 $("#roadInfo").css("top",mousePos.y);
		 $("#roadInfo").css("display","block");
		}
	}).mouseout(function(){
		if($(this).find("a").size()>0){
			$("#roadInfo").css("display","none");
		}
	});
});
function search(form) {
	$(form).appendPagerParaStr();
	return true;
}

function changeTab(str){
	if(str=='history'){
		 window.location="${ctx}/monitor/carved_discs_history_list.do";
	}else if(str=='upload'){
		window.location="${ctx}/monitor/carved_discs_upload_list.do";
	}else{
		window.location="${ctx}/monitor/carved_discs_manage_list.do";
	}
 
}
</script>
</head>
<body>
<%@ include file="/WEB-INF/view/common/topbar.jsp"%>
<div class="main-container" id="main-container">
	<div class="main-container-inner">
		<%@ include file="/WEB-INF/view/common/sidebar.jsp"%>
		<div class="main-content">
			<div class="breadcrumbs" id="breadcrumbs">
				<ul class="breadcrumb">
					<li>
						<i class="icon-home home-icon"></i>
						<a href="javascript:void(0);">首页</a>
					</li>
					<li>
						<a href="javascript:void(0);">数据交换监控</a>
					</li>
					<li>
						<a href="javascript:void(0);">刻盘管理</a>
					</li>
					<li>
						<a href="javascript:void(0);">历史刻盘记录</a>
					</li>
					<li class="active">详情</li>
					
				</ul>
			</div>

			<div class="page-content">
				<div class="row">
					<div class="col-xs-12">
						 <div class="tabbable">
						    <ul class="nav nav-tabs" id="myTab">
								<li>
									<a data-toggle="tab" href="#home" onclick="changeTab('download')">
										<i class="icon-cloud-download bigger-110"></i>
										刻盘管理
									</a>
								</li>
								<li class="active">
									<a data-toggle="tab" href="#" onclick="changeTab('history')">
									  <i class="green icon-cloud bigger-110"></i>
										刻盘历史
									</a>
								</li>
								<li>
									<a data-toggle="tab" href="#" onclick="changeTab('upload')">
									  <i class="icon-cloud-upload bigger-110"></i>
										上传管理
									</a>
								</li>
							</ul>
						<div class="tab-content">
						<div class="widget-box">
							<div class="widget-header header-color-white">
							    <h4 class="blue lighter">基础信息</h4>
								<div class="widget-toolbar no-border">
								<a class="btn btn-primary btn-xs" href="${ctx}/monitor/carved_discs_history_list.do"><i class="icon-arrow-left"></i> 返回&nbsp;&nbsp;</a>
								   <a href="#" data-action="collapse">
										<i class="icon-chevron-up"></i>
									</a>
								</div>
							</div>

							<div class="widget-body">
								<div class="widget-main padding-6 no-padding-left no-padding-right">
													<div class="profile-user-info profile-user-info-striped">
														<div class="profile-info-row">
															<div class="profile-info-name"> 刻录文件名 </div>
															<div class="profile-info-value">
																<span class="editable">${vo.carvedName}&nbsp;&nbsp;</span>
															</div>
														</div>
														<div class="profile-info-row">
															<div class="profile-info-name"> 刻录大小 </div>
															<div class="profile-info-value">
																<span class="editable">${vo.carvedSize}&nbsp;&nbsp;</span>
															</div>
														</div>
														<div class="profile-info-row">
															<div class="profile-info-name"> 刻录时间 </div>
															<div class="profile-info-value">
																<span class="editable">  ${si:fmtDate(vo.created)}&nbsp;&nbsp;</span>
															</div>
														</div>
												</div>
										</div>
							</div>
						</div>
						
						<div class="hr hr12 hr-dotted"></div>
						<div class="table-responsive">
							<table id="sample-table-1" class="table table-striped table-bordered table-hover">
								<thead>
									<tr>
										<th class="center">
											<label>
											<input type="checkbox" class="ace" id="checkedAll"/>
											<span class="lbl"></span>
											</label>
										</th>
										<th style="white-space: nowrap;">序号</th>
										<th style="white-space: nowrap;">交换请求编号</th>
										<th style="display: none;" >请求批次号</th>
										<th style="white-space: nowrap;">数据类型</th>
										<th style="white-space: nowrap;">审核人</th>
										<th style="white-space: nowrap;">交换路由信息</th>
										<th style="white-space: nowrap;">交换请求时间</th>
										<th style="white-space: nowrap;">文件总大小（B）</th>
										<th style="white-space: nowrap;">文件信息</th>
									</tr>
								</thead>

								<tbody>
									<c:forEach var="vo" items="${_data}" varStatus="sta">
									<tr id="msg_${vo.id}"> 
										<td class="center">
											<label>
											<%-- <c:if test="${vo.sendStatus == '0' || vo.sendStatus == '1' || vo.sendStatus == '3'}"> --%>
											<input type="checkbox" class="ace" value="${vo.id}"/>
											<%-- </c:if> --%>
											<span class="lbl"></span>
											</label>
										</td>
										 <td class="center">
									       ${sta.count}
									    </td>
									    <td style="width: 10%;">
									      ${vo.batchId }  
									    </td>
									    <td style="display: none;">
									      ${vo.batchId }             
									    </td>
										<td><span title="${si:dataName(vo.sendBusicode) }">${si:dataName(vo.sendBusicode) }</span></td>
										<td><span title="${vo.auditPerson}">${vo.auditPerson}</span></td>
										<td class="left mytip" >
												  <c:if test="${fn:contains(vo.recvNodecode,',') }">
												            一点多发                          <a data-action="collapse" href="#" style="position: absolute;" 
												                     data="{sendNodecode:'${si:nodeName(vo.sendNodecode)}',recvNodecode:'${vo.recvNodecode }',
												                     sendAdaptorcode:'${si:adaptorName(vo.sendAdaptorcode)}',recvAdaptorcode:'${vo.recvAdaptorcode}'}">
																	   <i class="icon-eye-open">
																	   </i>
																		<span name="recvNodecode" style="display: none;">
																			<c:forEach var="code" items="${fn:split(vo.recvNodecode,',')}" varStatus="sta">
																			   ${si:nodeName(code)},
																			</c:forEach>
																		</span>
																		<span name="recvAdaptorcode" style="display: none;">
																			<c:forEach var="code" items="${fn:split(vo.recvAdaptorcode,',')}" varStatus="sta">
																			   ${si:adaptorName(code)},
																			</c:forEach>
																		</span>
																	</a>
												  </c:if>
												  <c:if test="${!fn:contains(vo.recvNodecode,',') }">
												     <span  title="发送适配器"  class="tipMe fa fa-puzzle-piece">&nbsp;${si:adaptorName(vo.sendAdaptorcode)}</span>
												     <span class="icon-arrow-right"></span>
												     <span  class="tipMe icon-desktop" title="发送节点">&nbsp;${si:nodeName(vo.sendNodecode)}</span>
												     <span class="icon-arrow-right"></span>
												     <span  class="tipMe fa fa-cloud-download" title="刻盘">&nbsp;刻盘</span>
												     <span class="icon-arrow-right"></span>
												     <span  class="tipMe icon-desktop" title="接收节点">&nbsp;${si:nodeName(vo.recvNodecode)}</span>
												     <span class="icon-arrow-right"></span>
												     <span  title="接收适配器"  class="tipMe fa fa-puzzle-piece">&nbsp;${si:adaptorName(vo.recvAdaptorcode)}</span>
												     
												  </c:if>
												  
										</td>
										<td>${si:fmtDate(vo.requestDate)}</td>
										<td name="fileSize"><fmt:formatNumber value="${vo.filesize/1000}" pattern="#,###"/></td>
										<td>${si:formatterFile(vo.filepaths)}</td>
										
									</tr>
									</c:forEach>
								</tbody>
							</table>
							<jsp:include page="/WEB-INF/view/common/pg.jsp">
								<jsp:param value="${ctx}/monitor/carved_discs_history_get/${vo.id }.do" name="url"/>
								<jsp:param value="${_total}" name="total"/>
								<jsp:param value="${_urlpara}" name="urlpara" />
							</jsp:include>
						</div>
						</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>

<div class="popover fade bottom in" style="display: none;" id="roadInfo">
	<div class="arrow"></div>
	<h3 class="popover-title">一点多发路由</h3>
	<div class="popover-content"> Heads up! This alert needs your attention, but it's not super important.</div>
</div>
</body>
</html>
